﻿using System;
using System.Text;
using Portal.Core;
using System.Collections.ObjectModel;
using Portal.Exam.Bussiness;
using Portal.Exam.Model;

namespace Portal.Exam.Render
{
    public class ExamSubModulePermission:PermissionModuleTemplate
    {
        public override string ServiceId
        {
            get
            {
                return "ExamSubModulePermission";
            }
        }

        public override string ServiceName
        {
            get
            {
                return "Phân quyền cho nhóm câu hỏi";
            }
        }

        public override Collection<PermissionItemListCls> GetPermissionItemLists(string SiteId)
        {
            Collection<PermissionItemListCls>
                PermissionItemLists = new Collection<PermissionItemListCls> { };

            GroupQuestionCls[] GroupQuestions=GroupQuestionBll.ReadingGroupQuestion(SiteId, null);
            //doc danh sach nhom ra
            for (int iIndex = 0; iIndex < GroupQuestions.Length; iIndex++)
            {
                PermissionItemListCls OPermissionItemList = new PermissionItemListCls();
                OPermissionItemList.subject = GroupQuestions[iIndex].GroupQuestionName;
                OPermissionItemList.id = GroupQuestions[iIndex].GroupQuestionId;
                OPermissionItemList.ptc = GroupQuestionPermission.StaticId;
                PermissionItemLists.Add(OPermissionItemList);
            }
            return PermissionItemLists;
        }
    }
}
